package org.dromara.cms.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.cms.domain.CmsCategory;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

/**
 * CMS分类业务对象 cms_category
 *
 * @author Spring
 * @date 2024-12-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = CmsCategory.class, reverseConvertGenerate = false)
public class CmsCategoryBo extends BaseEntity {

    /**
     * 分类ID
     */
    @NotNull(message = "分类ID不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 分类标题
     */
    @NotBlank(message = "分类标题不能为空", groups = {AddGroup.class, EditGroup.class})
    private String title;


    /**
     * 父分类ID
     */
    @NotNull(message = "父分类ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long parentId;

    /**
     * 祖级列表
     */
//    @NotBlank(message = "祖级列表不能为空", groups = { AddGroup.class, EditGroup.class })
    private String ancestors;

    /**
     * 访问路径
     */
    @NotBlank(message = "访问路径不能为空", groups = {AddGroup.class, EditGroup.class})
    private String path;

    /**
     * 分类类型(article文章 page单页)
     */
    @NotBlank(message = "分类类型(article文章 page单页)不能为空", groups = {AddGroup.class, EditGroup.class})
    private String categoryType;



    /**
     * 显示顺序
     */
    @NotNull(message = "显示顺序不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long sort;

    /**
     * 是否显示(0隐藏 1显示)
     */
    @NotNull(message = "是否显示(0隐藏 1显示)不能为空", groups = {AddGroup.class, EditGroup.class})
    private String isShow;

    /**
     * SEO标题
     */
    @NotBlank(message = "SEO标题不能为空", groups = {AddGroup.class, EditGroup.class})
    private String seoTitle;

    /**
     * SEO关键词
     */
    @NotBlank(message = "SEO关键词不能为空", groups = {AddGroup.class, EditGroup.class})
    private String seoKeywords;

    /**
     * SEO描述
     */
    @NotBlank(message = "SEO描述不能为空", groups = {AddGroup.class, EditGroup.class})
    private String seoDescription;

    /**
     * 扩展字段(JSON格式)
     */
//    @NotBlank(message = "扩展字段(JSON格式)不能为空", groups = { AddGroup.class, EditGroup.class })
    private String customFields;


    /**
     * 备注
     */
    private String remark;

    /**
     * 分类名称
     */
    private String categoryName;

    /**
     * 链接类型
     */
    @NotNull(message = "链接类型", groups = {AddGroup.class, EditGroup.class})
    private Long linkType;

    /**
     * 链接打开方式
     */
    private String linkTarget;
    /**
     * 页面模板
     */
    @NotBlank(message = "页面模板不能为空", groups = {AddGroup.class, EditGroup.class})
    private String template;
}
